//
// Created by Tan Ke on 2023/11/26.
//

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int minCostToMoveChips(int* position, int positionSize)
{
    int val_1 = 0;
    int val_2 = 0;

    for (int i = 0; i < positionSize; i ++) {
        if (position[i] % 2 == 0) {
            val_1 += 1;
        } else {
            val_2 += 1;
        }
    }

    if (val_1 < val_2) {
        return val_1;
    } else {
        return val_2;
    }
}

int main(void)
{
    int nums[5] = {1, 2, 2, 2, 2};
    printf("%d\n", minCostToMoveChips(nums, 5));

    return 0;
}